<include file="Public/min-header"/>
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<div class="wrapper">
  <include file="Public/breadcrumb"/>
  <section class="content">
    <div class="container-fluid">
      <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title"><i class="fa fa-list"></i> 结算记录</h3>
        </div>
        <div class="panel-body">    
		<div class="navbar">                    
                <form id="search-form2" class="navbar-form form-inline"  method="get" action="{:U('order_statis')}" style="padding: 0;">
                <div class="form-group">                  
                   <div class="input-group">                    
                    <div class="input-group-addon">
                        	时间 <i class="fa fa-calendar"></i>
                    </div>
                       <input type="text" id="create_date" value="{$create_date}" name="create_date" class="form-control pull-right" style="width: 250px">
                  </div>                  
                </div>
                <div class="form-group">    
                    <button class="btn btn-primary" id="button-filter search-order" type="submit"><i class="fa fa-search"></i> 筛选</button>    
                </div><!-- <span style="color: red;"> 新功能提示：12月前结算明细仅供参考，1月后结算明细才精准！</span> -->
                </form>    
          </div>                        
          <div id="ajax_return">                  
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th class="sorting text-left">ID</th>
                                <th class="sorting text-left">银行名称</th>                                                                                              
                                <th class="sorting text-left">银行账号</th>
                                <th class="sorting text-left">开户人	</th>
                                <th class="sorting text-left">结算金额</th>
								<th class="sorting text-left">退货金额</th>
								<th class="sorting text-left">手续费</th>
								<th class="sorting text-left">其他费用（乐捐/赞助）</th>
								<th class="sorting text-left">应收金额</th>
<!--                                <th class="sorting text-left">积分金额</th> -->
                                <!-- <th class="sorting text-left">分销金额</th> -->                                
                                <!-- <th class="sorting text-left">优惠价</th> -->
<!--                                <th class="sorting text-left">优惠券抵扣</th>  -->                                                              
                                <!-- <th class="sorting text-left">状态</th> -->
                                <th class="sorting text-left">结算时间</th>
								<th class="sorting text-left">备注</th>
                                <!--<th class="sorting text-left">申请提现记录</th>-->
                            </tr>
                            </thead>
                            <tbody>
                            <volist name="list" id="v">
                                <tr>
                                    <td class="text-left">{$v.id}</td>                                    
                                    <td class="text-left">{$v.bank_name}</td>
                                    <td class="text-left">{$v.account_bank}</td>
                                    <td class="text-left">{$v.account_name}</td>
									<td class="text-left" style="color:red;">{$v.money}
									<a href="javascript:" id="chakan" rev="order_statis_shouhuo" style="float: right;" rel="{$v.id}" class="fa fa-eye">明细</a></td>
									<td class="text-left" style="color: green;">-{$v.th_money}
									<a href="javascript:" id="chakan" rev="order_statis_tuihuo" style="float: right;" rel="{$v.id}" class="fa fa-eye">明细</a></td>
									<td class="text-left" style="color: blue;">{$v.sxf_money}</td>
									<td class="text-left" style="color: red;">{$v.expenses}</td>
									<td class="text-left" style="color: red;">{$v.yf_money}</td>
									<td class="text-left">{$v.create_time|date="Y-m-d",###}</td>
                                    <td class="text-left">{$v.remark}</td>
                                </tr>
                            </volist>
							<tr>
								<td colspan="4" align="right"><b>合计：</b></td>
								<td style="font-size: 15px;color: red;">{$hejiprice}</td>
								<td style="font-size: 15px;color: green;">-{$tuihuo_heji}</td>
								<td style="font-size: 15px;color: blue;">-{$shouxufei_heji}</td>
								<td style="font-size: 15px;color: blue;"></td>
								<td style="font-size: 15px;color: red;">{:sanwei($hejiprice-$tuihuo_heji-$shouxufei_heji-$expenses)}</td>
							</tr>
                            </tbody>
                        </table>
                    </div>
                
                <div class="row">
                    <div class="col-sm-6 text-left"></div>
                    <div class="col-sm-6 text-right">{$show}</div>
                </div>
          
          </div>
        </div>
      </div>
    </div>
    <!-- /.row --> 
  </section>
  <!-- /.content --> 
</div>
<!-- /.content-wrapper --> 
 <script>
 
$(document).ready(function() {
	$('#create_date').daterangepicker({
		format:"YYYY-MM-DD HH:mm",
		singleDatePicker: false,
		showDropdowns: true,
		minDate:'2021-01-01 00:00',
		maxDate:'2030-01-01 00:00',
		startDate:'{:date("Y-m-d")} 00:00',
		showWeekNumbers: true,
		timePicker: true,
		timePickerIncrement: 1,
		timePicker12Hour: false,
		ranges: {
		   '今天': [moment(), moment()],
		   '昨天': [moment().subtract('days', 1), moment().subtract('days', 1)],
		   '最近7天': [moment().subtract('days', 6), moment()],
		   '最近30天': [moment().subtract('days', 29), moment()],
		   '上一个月': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
		},
		opens: 'right',
		buttonClasses: ['btn btn-default'],
		applyClass: 'btn-small btn-primary',
		cancelClass: 'btn-small',
		locale : {
		    applyLabel : '确定',
		    cancelLabel : '取消',
		    fromLabel : '起始时间',
		    toLabel : '结束时间',
		    customRangeLabel : '自定义',
		    daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
		    monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月','七月', '八月', '九月', '十月', '十一月', '十二月' ],
		    firstDay : 1
		}
	});

$(".table-responsive #chakan").click(function(){
		var myrel=$(this).attr('rel');
		var mytype=$(this).attr('rev');
		var myrul='/index.php/Seller/Finance/'+mytype+'/id/'+myrel;//+myrel;
			layer.open({
			  type: 2,
			  title:'结算明细',
			  shadeClose: true, //点击遮罩关闭
			  skin: 'layui-layer-rim', //加上边框
			  area: ['920px', '620px'], //宽高
			  content: myrul
		})
    });
	
});
</script>
</body>
</html>